package com.gupaoedu.pattern.singleton.lazy;

/**
 * 2019/5/10
 * created by chenpp
 */
public class LazySingletonTest {
    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            public void run() {
                //LazySimpleSingleton simpleSingleton = LazySimpleSingleton.getInstance();
                //LazyDoubleCheckSingleton simpleSingleton = LazyDoubleCheckSingleton.getInstance();
                LazyInnerClassSingleton simpleSingleton = LazyInnerClassSingleton.getInstance();
                System.out.println(simpleSingleton);
            }
        });
        thread.start();
        Thread thread2 = new Thread(new Runnable() {
            public void run() {
                //LazySimpleSingleton simpleSingleton = LazySimpleSingleton.getInstance();
                // LazyDoubleCheckSingleton simpleSingleton = LazyDoubleCheckSingleton.getInstance();
                LazyInnerClassSingleton simpleSingleton =  LazyInnerClassSingleton.getInstance();

                System.out.println(simpleSingleton);
            }
        });
        thread2.start();

    }

}
